Fix coords returned by _gdk_windowing_window_get_pointer, fixes scribble demo
authorRichard Hult <richard@imendio.com>
Sat, 31 Jan 2009 20:16:27 +0000 (21:16 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:31 +0000 (10:15 +0200)
gdk/quartz/gdkwindow-quartz.c

index a2541d7c4cf7ae7eba816be0d5df995542c99386..c91d06a3e375919b8140ee775fc34837e38a60e8 100644 (file)
@@ -1784,20 +1784,11 @@ _gdk_windowing_window_get_pointer (GdkDisplay      *display,
       nswindow = impl->toplevel;
 
       point = [nswindow mouseLocationOutsideOfEventStream];
+
       x_tmp = point.x;
       y_tmp = private->height - point.y;
-    }
 
-  /* The coords are relative to the toplevel of the passed in window
-   * at this point, make them relative to the passed in window:
-   */
-  private = GDK_WINDOW_OBJECT (window);
-  while (private != toplevel)
-    {
-      x_tmp -= private->x;
-      y_tmp -= private->y;
-
-      private = private->parent;
+      window = toplevel;
     }
 
   found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp);